import { ValidationArguments, ValidatorConstraint, ValidatorConstraintInterface } from "class-validator";

@ValidatorConstraint()
export class MyValidator implements ValidatorConstraintInterface {
    async validate(value: string, validationArguments?: ValidationArguments): Promise<boolean> {
        return new Promise<boolean>((resolve) => {
            setTimeout(() => {
                resolve(value.includes(validationArguments.constraints[0]))
            }, 3000);
        })
    }
}